package com.ytc.service;

import com.ytc.model.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-provider")
public interface BookService {
    @RequestMapping("querySwords")
    Long querySwords(@RequestParam("uId") Integer uId);

    //柴晓颖：查询章节内容
    @RequestMapping("queryChapter")
    List<Book> queryChapter(@RequestParam("bookid") Integer bookid);

    //柴晓颖：查询上一章章节名
    @RequestMapping("queryLastChaptername")
    String queryLastChaptername(@RequestParam("bookid") Integer bookid);

    //柴晓颖：新增章节内容
    @PostMapping("addChapter")
    void addChapter(@RequestBody Book book);

    //柴晓颖：查找章节去修改内容
    @RequestMapping("queryChapterByChapterid")
    Book queryChapterByChapterid(@RequestParam("bChapterid") Integer bChapterid);

    //柴晓颖：修改章节内容
    @PostMapping("updateChapter")
    void updateChapter(@RequestBody Book book);

    //柴晓颖：删除章节内容
    @RequestMapping("delChapter")
    void delChapter(@RequestParam("bChapterid") Integer bChapterid);

    //柴晓颖：预览章节内容
    @RequestMapping("preview")
    Book preview(@RequestParam("bChapterid") Integer bChapterid);
}
